# 连接登录的微信
from pywinauto import Application

app = Application(backend="uia").connect(title="微信")
# 获取微信的元素
dlg = app["微信"]
#获取元素的宽高
height_z = dlg.child_window(title="通讯录", control_type="Button").rectangle().height()
width_z = dlg.child_window(title="通讯录", control_type="Button").rectangle().width()
print(height_z,width_z)